home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 July: Mac OS SDK / Dev.CD Jul 00 SDK2.toast / Development Kits / Cross Platform / QuickTime 4.1.2 Windows SDK / CIncludes / CoreFoundation / CFArray.h next >
Encoding:
C/C++ Source or Header  |  2000-04-12  |  4.8 KB  |  194 lines  |  [TEXT/R*ch]

  1. /*
  2.      File:        CFArray.h
  3.  
  4.      Contains:    CoreFoundation array collection
  5.  
  6.      Version:    Technology:    Mac OS X
  7.                  Release:    QuickTime 4.1
  8.  
  9.      Copyright:    (c) 1999 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __COREFOUNDATION_CFARRAY__
  18. #define __COREFOUNDATION_CFARRAY__
  19.  
  20. #ifndef __COREFOUNDATION_CFBASE__
  21.     #include <CoreFoundation\CFBase.h>
  22. #endif
  23.  
  24.  
  25.  
  26.  
  27. #if PRAGMA_ONCE
  28. #pragma once
  29. #endif
  30.  
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif
  34.  
  35. #if PRAGMA_IMPORT
  36. #pragma import on
  37. #endif
  38.  
  39. #if PRAGMA_STRUCT_ALIGN
  40.     #pragma options align=mac68k
  41. #elif PRAGMA_STRUCT_PACKPUSH
  42.     #pragma pack(push, 2)
  43. #elif PRAGMA_STRUCT_PACK
  44.     #pragma pack(2)
  45. #endif
  46.  
  47. typedef CALLBACK_API_C( const void *, CFArrayRetainCallBack )(CFAllocatorRef allocator, const void *ptr);
  48. typedef CALLBACK_API_C( void , CFArrayReleaseCallBack )(CFAllocatorRef allocator, const void *ptr);
  49. typedef CALLBACK_API_C( CFStringRef , CFArrayCopyDescriptionCallBack )(const void *ptr);
  50. typedef CALLBACK_API_C( Boolean , CFArrayEqualCallBack )(const void *ptr1, const void *ptr2);
  51.  
  52. struct CFArrayCallBacks {
  53.     CFIndex                         version;
  54.     CFArrayRetainCallBack             retain;
  55.     CFArrayReleaseCallBack             release;
  56.     CFArrayCopyDescriptionCallBack     copyDescription;
  57.     CFArrayEqualCallBack             equal;
  58. };
  59. typedef struct CFArrayCallBacks            CFArrayCallBacks;
  60. extern const CFArrayCallBacks kCFTypeArrayCallBacks;
  61. typedef CALLBACK_API_C( void , CFArrayApplierFunction )(const void *val, void *context);
  62. typedef const struct __CFArray * CFArrayRef;
  63. typedef struct __CFArray * CFMutableArrayRef;
  64. EXTERN_API_C( CFTypeID )
  65. CFArrayGetTypeID                (void);
  66.  
  67.  
  68. EXTERN_API_C( CFArrayRef )
  69. CFArrayCreate                    (CFAllocatorRef         allocator,
  70.                                  const void **            values,
  71.                                  CFIndex                 numValues,
  72.                                  const CFArrayCallBacks * callBacks);
  73.  
  74. EXTERN_API_C( CFArrayRef )
  75. CFArrayCreateCopy                (CFAllocatorRef         allocator,
  76.                                  CFArrayRef             srcArray);
  77.  
  78. EXTERN_API_C( CFMutableArrayRef )
  79. CFArrayCreateMutable            (CFAllocatorRef         allocator,
  80.                                  CFIndex                 capacity,
  81.                                  const CFArrayCallBacks * callBacks);
  82.  
  83. EXTERN_API_C( CFMutableArrayRef )
  84. CFArrayCreateMutableCopy        (CFAllocatorRef         allocator,
  85.                                  CFIndex                 capacity,
  86.                                  CFArrayRef             srcArray);
  87.  
  88.  
  89. EXTERN_API_C( CFIndex )
  90. CFArrayGetCount                    (CFArrayRef             theArray);
  91.  
  92. EXTERN_API_C( CFIndex )
  93. CFArrayGetCountOfValue            (CFArrayRef             theArray,
  94.                                  CFRange                 range,
  95.                                  const void *            value);
  96.  
  97. EXTERN_API_C( Boolean )
  98. CFArrayContainsValue            (CFArrayRef             theArray,
  99.                                  CFRange                 range,
  100.                                  const void *            value);
  101.  
  102. EXTERN_API_C( const void *)
  103. CFArrayGetValueAtIndex            (CFArrayRef             theArray,
  104.                                  CFIndex                 idx);
  105.  
  106. EXTERN_API_C( void )
  107. CFArrayGetValues                (CFArrayRef             theArray,
  108.                                  CFRange                 range,
  109.                                  const void **            values);
  110.  
  111. EXTERN_API_C( void )
  112. CFArrayApplyFunction            (CFArrayRef             theArray,
  113.                                  CFRange                 range,
  114.                                  CFArrayApplierFunction  applier,
  115.                                  void *                    context);
  116.  
  117. EXTERN_API_C( CFIndex )
  118. CFArrayGetFirstIndexOfValue        (CFArrayRef             theArray,
  119.                                  CFRange                 range,
  120.                                  const void *            value);
  121.  
  122. EXTERN_API_C( CFIndex )
  123. CFArrayGetLastIndexOfValue        (CFArrayRef             theArray,
  124.                                  CFRange                 range,
  125.                                  const void *            value);
  126.  
  127. EXTERN_API_C( CFIndex )
  128. CFArrayBSearchValues            (CFArrayRef             theArray,
  129.                                  CFRange                 range,
  130.                                  const void *            value,
  131.                                  CFComparatorFunction     comparator,
  132.                                  void *                    context);
  133.  
  134.  
  135. EXTERN_API_C( void )
  136. CFArrayAppendValue                (CFMutableArrayRef         theArray,
  137.                                  const void *            value);
  138.  
  139. EXTERN_API_C( void )
  140. CFArrayInsertValueAtIndex        (CFMutableArrayRef         theArray,
  141.                                  CFIndex                 idx,
  142.                                  const void *            value);
  143.  
  144. EXTERN_API_C( void )
  145. CFArraySetValueAtIndex            (CFMutableArrayRef         theArray,
  146.                                  CFIndex                 idx,
  147.                                  const void *            value);
  148.  
  149. EXTERN_API_C( void )
  150. CFArrayRemoveValueAtIndex        (CFMutableArrayRef         theArray,
  151.                                  CFIndex                 idx);
  152.  
  153. EXTERN_API_C( void )
  154. CFArrayRemoveAllValues            (CFMutableArrayRef         theArray);
  155.  
  156. EXTERN_API_C( void )
  157. CFArrayReplaceValues            (CFMutableArrayRef         theArray,
  158.                                  CFRange                 range,
  159.                                  const void **            newValues,
  160.                                  CFIndex                 newCount);
  161.  
  162. EXTERN_API_C( void )
  163. CFArrayExchangeValuesAtIndices    (CFMutableArrayRef         theArray,
  164.                                  CFIndex                 idx1,
  165.                                  CFIndex                 idx2);
  166.  
  167. EXTERN_API_C( void )
  168. CFArraySortValues                (CFMutableArrayRef         theArray,
  169.                                  CFRange                 range,
  170.                                  CFComparatorFunction     comparator,
  171.                                  void *                    context);
  172.  
  173.  
  174. #if PRAGMA_STRUCT_ALIGN
  175.     #pragma options align=reset
  176. #elif PRAGMA_STRUCT_PACKPUSH
  177.     #pragma pack(pop)
  178. #elif PRAGMA_STRUCT_PACK
  179.     #pragma pack()
  180. #endif
  181.  
  182. #ifdef PRAGMA_IMPORT_OFF
  183. #pragma import off
  184. #elif PRAGMA_IMPORT
  185. #pragma import reset
  186. #endif
  187.  
  188. #ifdef __cplusplus
  189. }
  190. #endif
  191.  
  192. #endif /* __COREFOUNDATION_CFARRAY__ */
  193.  
  194.